<div id="btn_menu" class="flex items-center justify-center gap-2">
  <div id="btn-menu" class="btn-menu cursor-pointer">
    <i></i>
    <i></i>
    <i></i>
    <i></i>
    <i></i>
  </div>
  <span class="hidden">MENU</span>
</div>

<style>
  #btn-menu {
    align-items: center;
    display: flex;
    gap: 2px;
  }

  #btn-menu i {
    background-color: #000;
    transition: all 0.3s;
    width: 4px;
  }

  #btn-menu i:first-child {
    height: 15px;
  }

  #btn-menu i:nth-child(2) {
    height: 25px;
  }

  #btn-menu i:nth-child(3) {
    height: 25px;
    margin-top: 10px;
  }

  #btn-menu i:nth-child(4) {
    height: 25px;
  }

  #btn-menu i:nth-child(5) {
    height: 15px;
  }

  .icon-transform-x i:first-child {
    opacity: 0;
  }

  .icon-transform-x i:nth-child(2) {
    height: 35px !important;
    transform: rotate(45deg) translate(8px);
  }

  .icon-transform-x i:nth-child(3) {
    opacity: 0;
  }

  .icon-transform-x i:nth-child(4) {
    height: 35px !important;
    transform: rotate(-45deg) translate(-8px);
  }

  .icon-transform-x i:nth-child(5) {
    opacity: 0;
  }

  .color_open {
    background-color: #000 !important;
  }
</style>

<script>
  const btnMenu = document.getElementById('btn_menu');
  const strokes = [...document.getElementsByTagName('i')];
  const slides = [...document.getElementsByClassName("swiper-slide")];
  btnMenu.addEventListener('click', () => {
    document.getElementById('btn-menu').classList.toggle('icon-transform-x');
    document.getElementById('content-menu').classList.toggle('open');
    document.getElementById('menu-nav').classList.toggle('bg-[#fff]');
    strokes.map((e) => {
      e.classList.toggle('text-[#000]');
      e.classList.toggle('color_open');
    });
    slides.map(e=>{
        e.classList.toggle("pl-open-menu")
    });
  });
</script>
